package com.abc.service.impl;

import com.abc.dao.SwiperMapper;
import com.abc.entity.Swiper;
import com.abc.service.SwiperService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;

@Service
public class SwiperServiceImpl implements SwiperService {

    @Autowired
    SwiperMapper swiperMapper;

    @Override
    public void flushAll(List<Swiper> swiperList) {
        swiperMapper.deleteAll();
        for (Swiper swiper : swiperList) {
            swiper.setId(null);
            swiperMapper.insertSwiper(swiper);
        }
    }
}
